/**
 * Created by Dalyn on 2017/3/2.
 */
/*导入模块*/
import React from 'react';
import { Router, Route, hashHistory,IndexRoute } from 'react-router';
import { Layout, Menu, Breadcrumb, Icon } from 'antd';
const { SubMenu } = Menu;
const { Header, Content, Sider } = Layout;
import './css/Title.css';
/*导入组件*/
import Title from "./Title"
import Tab from './Tab';
import Tab_test from './Tab_test';
import Home from "../home/Home";
import Company from "../company/Company";
import CompanyInfo from '../company/Company_info';
import People from "../people/People";
import Limit from "../limit/Limit";
import EditLimit from "../limit/EditLimit";
import Product from "../product/Product";
import ProductImport from "../product/ProductImport";
/*销售管理*/
import ListOrder from "../order/ListOrder";
import ListOrder_saleno from "../order/ListOrder_sale_no";
import ListOrder_saleyes from "../order/ListOrder_sale_yes";
/*采购管理*/
import ListOrder_purch from "../order/order_purch/ListOrder_purch";
import ListOrder_purch_no from "../order/order_purch/ListOrder_purch_no";
import ListOrder_purch_yes from "../order/order_purch/ListOrder_purch_yes";
import Create_proofing from '../order/create_proofing';
/*新建订单*/
import Createorder_gms from "../order/createOrder/Createorder_gms";
import Createorder_cloth from "../order/createOrder/Createorder_cloth";
import Createorder_raw from "../order/createOrder/Createorder_raw";
import Createorder_yarn from "../order/createOrder/Createorder_yarn";
import Createorder_print from "../order/createOrder/Createorder_print";
import CreatOrderByStep from "../order/createOrder/CreatOrderByStep"

/*订单详情*/
import Orderdetail from "../order/order_detail/Orderdetail";
import Orderdetail_gms from "../order/order_detail/Orderdetail_gms";
import Orderdetail_cloth from "../order/order_detail/Orderdetail_cloth";
import Orderdetail_print from "../order/order_detail/Orderdetail_print";
import Orderdetail_raw from "../order/order_detail/Orderdetail_raw";
import Orderdetail_yarn from "../order/order_detail/Orderdetail_yarn";
import OrderIndex from '../order/order_detail/order_index/Order_index';
import OrderDetailIndex from '../order/order_detail/order_index/order_detail_index/OrderDetailIndex';

import Mycenter from "./TitleComponent/Mycenter"
import Companyhome from "../order/Companyhome"
import OrderProgress from '../order/order_progress/OrderProgress'

import GoodsRecord from "../order/GoodsRecord"
import SendGoods from "../order/SendGoods"
import SendGoodsRecord from "../order/SendGoodsRecord"

import ReceiveGoods from "../order/order_purch/ReceiveGoods"
import ReceiveGoodsItem from "../order/order_purch/ReceiveGoodsItem"
import ReceiveGoodsDetil from "../order/order_purch/ReceiveGoodsDetil"
import OrderRecordDetil from "../order/order_purch/OrderRecordDetil"

import PublishOrder from "../order/createOrder/PublishOrder"
/*贷款流程*/
import LoanRecord from "../account/LoanRecord"
/*充值*/
import RechargeOrder from "../account/RechargeOrder"
import RechargeRecordCompany from "../account/RechargeRecordCompany"
/*结算*/
import SettlementRecord from "../account/SettlementRecord"
import SettlementProcess from "../account/SettlementProcess"
/*交易记录*/
import OrderTradeList from "../account/OrderTradeList"
import OrderTradeInfo from "../account/OrderTradeInfo"
import Payment from "../account/Payment"
import PaymentHistory from "../account/PaymentHistory"
import SettlementView from "../account/SettlementView"
import TaxRefundManagement from '../account/TaxRefundManagement'
/*意见反馈*/
import SuggestList from "./TitleComponent/suggestList/SuggestList"
import SuggestDetail from "./TitleComponent/suggestList/SuggestDetail"
/*消息列表*/
import MessageList from './MessageList'
/*订单付款*/
import OrderPaymentList from '../account/OrderPaymentList'
import OrderTree from '../order/order_tree/OrderTree';
import UpDownStreamShow from '../order/updownstream_show';
/*生产管理*/
import ProductionSchedule from "../productionManagement/factoryResourcesDetail/sewing";
//生产统计编辑页面
import Progress from '../productionStatistics/ProductionSchedule';
import ProgressDetail from '../productionStatistics/ProductionSchedule/detail';

import CutNum from '../productionStatistics/Statistics/CutNum';
import PackNum from '../productionStatistics/Statistics/PackNum';
import SewNum from '../productionStatistics/Statistics/SewNum';
import AfterAllNum from '../productionStatistics/Statistics/AfterAllNum';
//生产统计 查看页面
import ProgressLook from '../productionStatistics/ProductionScheduleLook';
import CutNumLook from '../productionStatistics/StatisticsLook/CutNum';
import PackNumLook from '../productionStatistics/StatisticsLook/PackNum';
import SewNumLook from '../productionStatistics/StatisticsLook/SewNum';
import AfterAllNumLook from '../productionStatistics/StatisticsLook/AfterAllNum';


import ProductionLicense from "../productionManagement/ProductionLicense";
import ProductionLicenseIndex from "../productionManagement/productionLicense/ProductionLicense_index";
import FabricRawProcess from "../productionManagement/FabricRawProcess";
import FabricRawLook from "../productionManagement/FabricRawProcess/FabricRawLook";
import FabricRawEdit from "../productionManagement/FabricRawProcess/FabricRawEdit";
import ProductionProcess from "../productionManagement/ProductionProcess";
import ProductionProcessDetail from "../productionManagement/ProductionProcessDetail";

//工厂资源
import Factoryresource from "../productionManagement/Factoryresource";
import Factoryresource_look from "../productionManagement/Factoryresource_look";
import FactoryresourceDetails from '../productionManagement/factoryResourcesDetail/tailoring';
//生产排期
import ProductionScheduling from "../productionManagement/ProductionScheduling/ProductionScheduling";
import ProductionScheduling_look from "../productionManagement/ProductionScheduling/ProductionScheduling_look";
import CraeteProductionScheduling from "../productionManagement/ProductionScheduling/createProductionScheduling";

/*路由参数*/
const navs = [
    {name: "首页", path: "/home", component: Home, isShowTitle: false},
    {name: "企业设置", path: "/company", component: CompanyInfo, isShowTitle: false},
    {name: "企业设置信息展示",path:"/companyinfo",component: Company,isShowTitle:false},
    {name: "人员管理", path: "/people", component: People, isShowTitle: false},
    {name: "权限限制", path: "/limit", component: Limit, isShowTitle: false},
    {name: "编辑权限", path: "/editLimit(/:id)", component: EditLimit, isShowTitle: false},
    {name: "已签订单", path: "/ordersaleyes", component: ListOrder_saleyes, isShowTitle: false},
    {name: "未签订单", path: "/ordersaleno", component: ListOrder_saleno, isShowTitle: false},
    {name: "采购订单", path: "/orderpurch", component: ListOrder_purch, isShowTitle: false},
    {name: "录入成衣订单", path: "/entryordergms", component: CreatOrderByStep, isShowTitle: false},
    {name: "采购已签订单", path: "/orderpurchyes", component: ListOrder_purch_yes, isShowTitle: false},
    {name: "采购未签订单", path: "/orderpurchno", component: ListOrder_purch_no, isShowTitle: false},
    {name: "新建成衣订单", path: "/createordergms", component: Createorder_gms, isShowTitle: false},
    {name: "新建面料订单", path: "/createordercloth", component: Createorder_cloth, isShowTitle: false},
    {name: "新建辅料订单", path: "/createorderraw", component: Createorder_raw, isShowTitle: false},
    {name: "新建纱线订单", path: "/createorderyarn", component: Createorder_yarn, isShowTitle: false},
    {name: "新建印染订单", path: "/createorderprint", component: Createorder_print, isShowTitle: false},
    {name: "新建成衣打样", path: "/createproofing", component:Create_proofing, isShowTitle: false},

    {name: "按步骤创建订单", path: "/creatorderbystep", component: CreatOrderByStep, isShowTitle: false},
    {name: "订单详情主入口", path: "/OrderDetailIndex", component: OrderDetailIndex, isShowTitle: false},
    {name: "订单详情", path: "/Orderdetail", component: Orderdetail, isShowTitle: false},
    {name: "成衣订单详情", path: "/orderdetailgms(/:orderId)", component: Orderdetail_gms, isShowTitle: false},
    {name: "面料订单详情", path: "/orderdetailcloth(/:orderId)", component: Orderdetail_cloth, isShowTitle: false},
    {name: "纱线订单详情", path: "/orderdetailyarn(/:orderId)", component: Orderdetail_yarn, isShowTitle: false},
    {name: "印染订单详情", path: "/orderdetailprint(/:orderId)", component: Orderdetail_print, isShowTitle: false},
    {name: "辅料订单详情", path: "/orderdetailraw(/:orderId)", component: Orderdetail_raw, isShowTitle: false},
    {name: "订单主入口", path: "/OrderIndex(/:orderId)", component: OrderIndex, isShowTitle: false},
    {name: "产品管理", path: "/product", component: Product, isShowTitle: false},
    {name: "产品导入", path: "/productimport", component: ProductImport, isShowTitle: false},
    {name: "个人中心", path: "/mycenter", component: Mycenter, isShowTitle: false},
    {name: "企业主页", path: "/companyhome", component: Companyhome, isShowTitle: false},
    {name: "借款记录企业端", path: "/loanrecord", component: LoanRecord, isShowTitle: false},
    {name: "充值（流程）", path: "/rechargeorder", component: RechargeOrder, isShowTitle: false},
    {name: "充值（企业）", path: "/rechargerecordcompany", component: RechargeRecordCompany, isShowTitle: false},
    {name: "结算（金融）", path: "/settlementrecord", component: SettlementRecord, isShowTitle: false},
    {name: "结算（金融）", path: "/settlementprocess", component: SettlementProcess, isShowTitle: false},
    {name: "交易记录（企业）", path: "/ordertradelist", component: OrderTradeList, isShowTitle: false},
    {name: "交易记录（详情）", path: "/ordertradeinfo(/:oid)", component: OrderTradeInfo, isShowTitle: false},
    {name: "退税管理", path: "/TaxRefundManagement(/:oid)", component: TaxRefundManagement, isShowTitle: false},
    {name: "支付", path: "/payment(/:oid)", component: Payment, isShowTitle: false},
    {name: "支付", path: "/paymentHistory(/:oid)", component: PaymentHistory, isShowTitle: false},
    {name: "支付", path: "/settlementView", component: SettlementView, isShowTitle: false},
    {name: "意见反馈", path: "/SuggestList", component: SuggestList, isShowTitle: false},
    {name: "反馈详情", path: "/SuggestDetail", component: SuggestDetail, isShowTitle: false},
    {name: "消息列表", path: "/MessageList", component: MessageList, isShowTitle: false},
    {name: "订单进度", path: "/OrderProgress(/:oid)", component: OrderProgress, isShowTitle: false},
    {name: "发货详情", path: "/goodsRecord(/:oid)", component: GoodsRecord, isShowTitle: false},
    {name: "发货", path: "/sendGoods(/:oid)", component: SendGoods, isShowTitle: false},
    {name: "发货记录", path: "/sendGoodsRecord(/:oid)", component: SendGoodsRecord, isShowTitle: false},

    {name: "确认收货", path: "/receiveGoods(/:oid)", component: ReceiveGoods, isShowTitle: false},
    {name: "确认收货列表", path: "/receiveGoodsItem(/:oid)", component: ReceiveGoodsItem, isShowTitle: false},
    {name: "确认收货列表记录详情", path: "/receiveGoodsDetil(/:oid)", component: ReceiveGoodsDetil, isShowTitle: false},
    {name: "确认收货列表记录详情", path: "/orderRecordDetil(/:oid)", component: OrderRecordDetil, isShowTitle: false},

    {name: "发布订单", path: "/publishOrder(/:oid)", component: PublishOrder, isShowTitle: false},
    {name: "订单付款", path: "/orderpaymentlist", component: OrderPaymentList, isShowTitle: false},
    {name: "订单树", path: "/ordertree", component: OrderTree, isShowTitle: false},
    {name:"上下游订单展示",path:"/orderstreamshow",component:UpDownStreamShow,isShowTitle:false},

    {name: "生产进度", path: "/progress", component: Progress, isShowTitle: false},
    {name: "生产进度详情", path: "/progressDetail", component: ProgressDetail, isShowTitle: false},

    {name: "裁剪产量统计", path: "/cutNum", component: CutNum, isShowTitle: false},
    {name: "包装产量统计", path: "/packNum", component: PackNum, isShowTitle: false},
    {name: "缝制产量统计", path: "/sewNum", component: SewNum, isShowTitle: false},
    {name: "后整产量统计", path: "/afterAllNum", component: AfterAllNum, isShowTitle: false},

    {name: "生产进度", path: "/progressLook", component: ProgressLook, isShowTitle: false},

    {name: "裁剪产量统计", path: "/cutNumLook", component: CutNumLook, isShowTitle: false},
    {name: "包装产量统计", path: "/packNumLook", component: PackNumLook, isShowTitle: false},
    {name: "缝制产量统计", path: "/sewNumLook", component: SewNumLook, isShowTitle: false},
    {name: "后整产量统计", path: "/afterAllNumLook", component: AfterAllNumLook, isShowTitle: false},


    {name: "生产制单", path: "/productionlicense(/:pdId)", component: ProductionLicense, isShowTitle: false},
    {name: "生产制单详情", path: "/productionlicenseindex(/:token)", component: ProductionLicenseIndex, isShowTitle: false},
    {name: "面辅料进度", path: "/fabricrawprocess", component: FabricRawProcess, isShowTitle: false},
    {name: "面辅料进度", path: "/fabricrawlook", component: FabricRawLook, isShowTitle: false},
    {name: "面辅料进度", path: "/fabricrawedit", component: FabricRawEdit, isShowTitle: false},
    {name: "生产进度", path: "/productionprocess", component: ProductionProcess, isShowTitle: false},
    {name: "生产进度更新", path: "/productionProcessDetail(/:gid)", component: ProductionProcessDetail, isShowTitle: false},
    {name: "工厂资源", path: "/factoryresource", component: Factoryresource, isShowTitle: false},
    {name: "工厂资源查看", path: "/factoryresourceLook", component: Factoryresource_look, isShowTitle: false},
    {name:"工厂资源详情页裁剪",path:"factoryresourceDetailsTailoring",component:FactoryresourceDetails,isShowTitle:false},
    {name: "工厂资源详情页缝制", path: "/factoryresourceDetailsSewing", component: ProductionSchedule, isShowTitle: false},
    {name: "生产排期", path: "/productionScheduling", component: ProductionScheduling, isShowTitle: false},
    {name: "生产排期查看", path: "/productionSchedulingLook", component: ProductionScheduling_look, isShowTitle: false},
    {name: "新建生产排期", path: "/createProductionScheduling", component: CraeteProductionScheduling, isShowTitle: false},
];
/*导出组件*/
export default class Main extends React.Component {
    /*默认属性状态*/
    constructor(props){
        super(props);
        // console.log(hashHistory.getCurrentLocation());
    }
    /*渲染前*/
    componentWillMount(){}
    /*渲染后*/
    componentDidMount(){}
    // shouldComponentUpdate(){}
    componentDidUpdate(){}
    /*移除*/
    componentWillUnmount(){}

    /*渲染*/
    render() {
        return (
            /*路由组件*/
            <Router history={hashHistory}>
              <Route path="/" component={TabComponent}>
                <IndexRoute component={Home}/>
                  {
                      navs.map((item,index) => {
                          return <Route {...item} key={index+'_'}/>
                      })
                  }
              </Route>
            </Router>
        );
    }
}

/*路由组件*/
class TabComponent extends React.Component{
    constructor(props){
        super(props)
    }
    render(){
        return(
            <div className = "main">
                <Header className="header">
                    <Title/>
                </Header>
                <div className="app-wrap app-content">
                    <Tab/>
                        {/*<Tab_test/>*/}
                    <div className="app-wrap">
                        <Content className="app-wrap">
                            <div className="app-container">
                                {this.props.children}
                            </div>
                        </Content>
                    </div>
                </div>
            </div>
        );
    }
}
let style = {
    main:{
        // position:"relative",
        width: '100%',
        backgroundColor:'#f5f5f5',
        margin:"0 auto",
        overflow:"hidden",
        clear:"both",
        zIndex:-1
    },
    title:{
        backgroundColor:'#f9f9f9',
        // paddingLeft:"166px",
        overflow:"hidden",
        clear:"both",
        zIndex:-1
    },
    box:{
        width: '1235px',
        margin:"0 auto",
        overflow:"hidden"
    }
};
